import request from '@/utils/request'
//结算单详情
export function statement_detail(statement_id) {
  return request({
    url: '/market/statement/statement_detail',
    method: 'post',
    data:{
     statement_id
    }
  })
}
//删除结算单里面的项目
export function statement_del_item(statement_id,item_id) {
  return request({
    url: '/market/statement/statement_del_item',
    method: 'post',
    data:{
     statement_id,
     item_id
    }
  })
}
//删除发票的
export function statement_cancel_hook_invoiceinvoice_id(statement_id,invoice_id) {
  return request({
    url: '/market/statement/statement_cancel_hook_invoice',
    method: 'post',
    data:{
     statement_id,
     invoice_id
    }
  })
}
//删除汇款单
export function statement_cancel_hook_huikuan(statement_id,huikuan_id) {
  return request({
    url: '/market/statement/statement_cancel_hook_huikuan',
    method: 'post',
    data:{
     statement_id,
     huikuan_id
    }
  })
}
//发票数据
export function invoice_no_hook(dat,statement_id) {
  return request({
    url: '/market/invoice/invoice_no_hook',
    method: 'post',
    data:{
     keyword:dat.keyword,
     page:dat.page,
     limit:dat.limit,
     statement_id,
    }
  })
}
//挂接已有发票
export function statement_hook_invoice(statement_id,invoice_id) {
  return request({
    url: '/market/statement/statement_hook_invoice',
    method: 'post',
    data:{
     statement_id,
     invoice_id
    }
  })
}
//回款数据
export function backmoney_no_hook(statement_id,dat) {
  return request({
    url: '/market/backmoney/backmoney_no_hook',
    method: 'post',
    data:{
      statement_id,
     keyword:dat.keyword,
     page:dat.page,
     limit:dat.limit
    }
  })
}
//挂接已有回款单
export function statement_hook_huikuan(statement_id,huikuan_id) {
  return request({
    url: '/market/statement/statement_hook_huikuan',
    method: 'post',
    data:{
     statement_id,
     huikuan_id
    }
  })
}
//归档结算单
export function statement_archives(statement_id) {
  return request({
    url: '/market/statement/statement_archives',
    method: 'post',
    data:{
     statement_id
    }
  })
}
//申请开发票
export function statement_apply_invoice(statement_id,dat) {
  return request({
    url: '/market/statement/statement_apply_invoice',
    method: 'post',
    data:{
     statement_id,
     item_ids:dat.item_ids,
     price:dat.price,
     remark:dat.remark,
     company_name:dat.company_name,
     company_num:dat.company_num,
     company_tel:dat.company_tel,
     company_addr:dat.company_addr,
     invoice_type:dat.invoice_type
    }
  })
}
//删除结算单
export function statement_del(statement_id) {
  return request({
    url: '/market/statement/statement_del',
    method: 'post',
    data:{
     statement_id,
    }
  })
}
// 修改价格/工作量
export function statement_edit_bus(statement_id,market_item_id,bus_id,load,artificial_price) {
  return request({
    url: '/market/statement/statement_edit_bus',
    method: 'post',
    data:{
     statement_id,
     market_item_id,
     bus_id,
     load,
     artificial_price,
    }
  })
}
//保存结算单信息
export function statement_save(statement_id,is_tixing,tixing_date) {
  return request({
    url: '/market/statement/statement_save',
    method: 'post',
    data:{
     statement_id,
     is_tixing,
     tixing_date
    }
  })
}
//生成最终结算单
export function statement_create_final(statement_id) {
  return request({
    url: '/market/statement/statement_create_final',
    method: 'post',
    data:{
     statement_id
    }
  })
}
//生成最终结算单
export function statement_change_fushu_or_jiesuan(statement_id,item_id,type) {
  return request({
    url: '/market/statement/statement_change_fushu_or_jiesuan',
    method: 'post',
    data:{
     statement_id,
     type,
     item_id
    }
  })
}
